import { apiService } from "@/services";

export const counterApi = apiService
  .enhanceEndpoints({
    addTagTypes: [],
  })
  .injectEndpoints({
    endpoints: ({ query, mutation }) => ({
      getCounter: query({
        query: () => "/api/counter",
      }),
      setCounter: mutation({
        query: (data) => ({
          url: "/api/counter/set",
          method: "POST",
          data: data,
        }),
      }),
    }),
  });

export const { useGetCounterQuery, useSetCounterMutation } = counterApi;
export default counterApi;
